Skip to content

Telegram connection error... #22

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
alirayaneh opened this issue Sep 26, 2024 · 6 comments
Open

Telegram connection error... #22

alirayaneh opened this issue Sep 26, 2024 · 6 comments

Comments

@alirayaneh
Copy link

Screenshot from 2024-09-27 02-31-54
hi why get this error ?
is it possible to use proxy by .env.docker ?
for example
TELEGRAM_PROXY_ADDRESS=127.0.0.1
TELEGRAM_PROXY_PORT=2080

@xtrime-ru
Copy link
Owner

This error means TelegramRSS cant connect to https://github.com/xtrime-ru/TelegramApiServer. Make sure you done all setup steps from TelegramApiServer docs too.

@seyar
Copy link

seyar commented Dec 23, 2024

Same issue.

telegram-rss  | http://SERVER:PORT/api/getInfoClient crashed and restarting. Resending request.
telegram-rss  | [2024-12-23 08:58:28] [warning] Client crashed and restarting. Resending request.

I recently updated telegram-rss and telegram-server. Rss crashing with same "connection error". I researched client tries to call getInfo Client but it not exists in server.

on getInfoClient I receive

{
    "success": false,
    "errors": [
        {
            "exception": "Error",
            "message": "Call to undefined method danog\\MadelineProto\\API::getInfoClient()",
            "file": "/app-host-link/src/Controllers/AbstractApiController.php",
            "line": 173,
            "code": 0,
            "backtrace": [
                {
                    "file": "/app-host-link/src/Controllers/ApiController.php",
                    "line": 50,
                    "function": "callApiCommon",
                    "class": "TelegramApiServer\\Controllers\\AbstractApiController",
                    "type": "->",
                    "args": [
                        {
                            "auth": {},
                            "account": {},
                            "users": {},
                            "contacts": {},
                            "messages": {},
                            "updates": {},
                            "photos": {},
                            "upload": {},
                            "help": {},
                            "channels": {},
                            "bots": {},
                            "payments": {},
                            "stickers": {},
                            "phone": {},
                            "langpack": {},
                            "folders": {},
                            "stats": {},
                            "chatlists": {},
                            "stories": {},
                            "premium": {},
                            "smsjobs": {},
                            "fragment": {}
                        }
                    ]
                },
                {
                    "file": "/app-host-link/src/Controllers/AbstractApiController.php",
                    "line": 140,
                    "function": "callApi",
                    "class": "TelegramApiServer\\Controllers\\ApiController",
                    "type": "->",
                    "args": []
                },
                {
                    "file": "/app-host-link/src/Controllers/AbstractApiController.php",
                    "line": 77,
                    "function": "generateResponse",
                    "class": "TelegramApiServer\\Controllers\\AbstractApiController",
                    "type": "->",
                    "args": []
                }
            ],
            "previous_exception": null
        }
    ],
    "response": null
}

@xtrime-ru
Copy link
Owner

Currently i cant find getInfoClient in source code. Please make sure you use latest versions of TelegramApiServer, TelegramApiServer and docker images.

@seyar
Copy link

seyar commented Dec 23, 2024

Привет @xtrime-ru Спасибо за ответ
Извините с getInfoClient. Это логи слились, там вызывалась команда getInfo()

Проблема с сетью из докеров внутри php. Отпишусь по дальнейшему research.
Оба докер образа в одной сети, обе сети external, прописан name и одинаково называются.
Причем если "зайти" в контейнер через docker compose exec -it telegram-rss sh и вызвать там curl с таким же путем http://telegram-server:9503/api/getInfo?id=xtrime ответ приходит. Т.е сети не видно почему-то из php http request клиента.

Лог вызова php

telegram-rss  | Next Amp\Http\Client\SocketException: Connection to 'telegram-server:9503' failed in /app-host-link/vendor/amphp/http-client/src/Connection/DefaultConnectionFactory.php:106
telegram-rss  | Stack trace:
telegram-rss  | #0 /app-host-link/vendor/amphp/amp/src/functions.php(34): Amp\Http\Client\Connection\DefaultConnectionFactory->create(Object(Amp\Http\Client\Request), Object(Amp\NullCancellation))
telegram-rss  | #1 /app-host-link/vendor/revolt/event-loop/src/EventLoop/Internal/AbstractDriver.php(422): Amp\{closure}(NULL, NULL, Array)
telegram-rss  | #2 /app-host-link/vendor/revolt/event-loop/src/EventLoop/Internal/AbstractDriver.php(612): Revolt\EventLoop\Internal\AbstractDriver->invokeMicrotasks()
telegram-rss  | #3 [internal function]: Revolt\EventLoop\Internal\AbstractDriver->Revolt\EventLoop\Internal\{closure}()
telegram-rss  | #4 /app-host-link/vendor/revolt/event-loop/src/EventLoop/Internal/DriverSuspension.php(54): Fiber->resume(NULL)
telegram-rss  | #5 /app-host-link/vendor/revolt/event-loop/src/EventLoop/Internal/AbstractDriver.php(422): Revolt\EventLoop\Internal\DriverSuspension::Revolt\EventLoop\Internal\{closure}()
....
telegram-rss  | [2024-12-23 18:37:58] [notice] "GET http://t-rss.chapukh.com:9504/rss/xtrime" 500 "Telegram connection error..." HTTP/1.1 172.23.0.6
telegram-rss  | {
telegram-rss  |     "request": {
telegram-rss  |         "method": "GET",
telegram-rss  |         "uri": "http://t-rss.chapukh.com:9504/rss/xtrime",
telegram-rss  |         "user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36",
telegram-rss  |         "referer": null,
telegram-rss  |         "remote": "172.23.0.6",
telegram-rss  |         "rpm": 1,
telegram-rss  |         "rpm_limit": 15,
telegram-rss  |         "errors": 0,
telegram-rss  |         "errors_limit": -1,
telegram-rss  |         "previous_ban": 0,
telegram-rss  |         "banned": 0
telegram-rss  |     },
telegram-rss  |     "response": {
telegram-rss  |         "status": 500,
telegram-rss  |         "reason": "Telegram connection error..."
telegram-rss  |     }
telegram-rss  | }

@xtrime-ru
Copy link
Owner

Возможно проблема в amphp/dns. Ранее такое уже случалось когда в docker 26 сменился формат resolv.conf файла:

amphp/dns@089f445

В качестве костыля я бы предложил указать ip либо добавить entrypoint скрипт, который будет резолвить url -> ip в баше и обновлять его в .env

@seyar
Copy link

seyar commented Dec 24, 2024

В качестве костыля я бы предложил указать ip либо добавить entrypoint скрипт, который будет резолвить url -> ip в баше и обновлять его в .env

Cпасибо. По айпи запросы проходят.

Thanks. Set static ip address in .env.docker file resolved issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants